﻿namespace WMS6.Web.CustomizeReport
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class YITAISerialNoInOutRptQuery : BasePage
    {
        protected Button btnSearch;
        protected DropDownList ddlCustID;
        protected DropDownList ddlExternalOrderID;
        protected DropDownList ddlExternalReceiptID;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlSku;
        protected DropDownList ddlVendorID;
        protected HtmlForm F16050;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected Label lblBeginReceiptDate;
        protected Label lblBeginShipDate;
        protected Label lblCustID;
        protected Label lblEndReceiptDate;
        protected Label lblEndShipDate;
        protected Label lblExternalOrderID;
        protected Label lblExternalReceiptID;
        protected Label lblOwnerID;
        protected Label lblSku;
        protected Label lblVendorID;
        protected HtmlLink mycss;
        protected Label one1;
        protected TextBox txtBeginReceiptDate;
        protected TextBox txtBeginShipDate;
        protected TextBox txtCustID;
        protected TextBox txtEndReceiptDate;
        protected TextBox txtEndShipDate;
        protected TextBox txtExternalOrderID;
        protected TextBox txtExternalReceiptID;
        protected TextBox txtOwnerID;
        protected TextBox txtSku;
        protected TextBox txtVendorID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("YITAISerialNoInOutRptList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlSku, 0);
            base.InitQueryDDL(this.ddlExternalReceiptID, 0);
            base.InitQueryDDL(this.ddlVendorID, 0);
            base.InitQueryDDL(this.ddlExternalOrderID, 0);
            base.InitQueryDDL(this.ddlCustID, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDropDownLists();
            }
        }

        public string BeginReceiptDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtBeginReceiptDate.Text.Trim()))
                {
                    return Convert.ToDateTime(this.txtBeginReceiptDate.Text).ToString("yyyy-MM-dd");
                }
                return "";
            }
        }

        public string BeginShipDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtBeginShipDate.Text.Trim()))
                {
                    return Convert.ToDateTime(this.txtBeginShipDate.Text).ToString("yyyy-MM-dd");
                }
                return "";
            }
        }

        public string CustID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtCustID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtCustID.Text.Trim(), this.ddlCustID.SelectedValue);
                }
                return "";
            }
        }

        public string EndReceiptDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtEndReceiptDate.Text.Trim()))
                {
                    return Convert.ToDateTime(this.txtEndReceiptDate.Text).ToString("yyyy-MM-dd");
                }
                return "";
            }
        }

        public string EndShipDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtEndShipDate.Text.Trim()))
                {
                    return Convert.ToDateTime(this.txtEndShipDate.Text).ToString("yyyy-MM-dd");
                }
                return "";
            }
        }

        public string ExternalOrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternalOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternalOrderID.Text.Trim(), this.ddlExternalOrderID.SelectedValue);
                }
                return "";
            }
        }

        public string ExternalReceiptID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternalReceiptID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternalReceiptID.Text.Trim(), this.ddlExternalReceiptID.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSku.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSku.Text.Trim(), this.ddlSku.SelectedValue);
                }
                return "";
            }
        }

        public string VendorID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtVendorID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtVendorID.Text.Trim(), this.ddlVendorID.SelectedValue);
                }
                return "";
            }
        }
    }
}

